#include "thread.h"
#include "console.h"

static mx_thread_t thread;
static mx_uint8_t thread_stack[8192];
static mx_int32_t thread_entry (mx_void_pt param)
{
    while (mx_true)
    {
        consoleline("this is kapp-thread");
        mx_thread_sleep(1000);
    }
    return 0;
}

mx_size_t main (mx_usize_t argc, char** argv)
{
    consoleline("kprocess app entried, param = %s", argv[0]);
    mx_thread_mount(&thread, "kapp-thread", 10, MX_DEFAULT_TICK,
                    thread_stack, len(mx_uint8_t, thread_stack), thread_entry, mx_null);
    mx_thread_start(&thread);
    return 112233;
}
